package com.ruoyi.system.service;


import com.ruoyi.system.domain.PoPublicOpinion;
import com.ruoyi.system.domain.PublicOpinionEvents;
import com.ruoyi.system.domain.PublicOpinionTopic;
import com.ruoyi.system.domain.vo.NameListValue;
import com.ruoyi.system.domain.vo.NameValue;

import java.io.IOException;
import java.util.List;

public interface ElasticsearchBasicService {

    /**
     * 批量修改舆情的情感属性
     * @param opinions
     * @return
     */
    int batchUpdateOpinionIndex(List<PoPublicOpinion> opinions) throws IOException;

    /**
     * 单个修改舆情的情感属性
     * @param opinion
     * @return
     */
    int updateOpinionIndex(PoPublicOpinion opinion) throws IOException;

    /**
     * 今日预警总数
     * @param ids
     * @return
     */
    Integer getTodayAlertCount(List<String> ids);


    /**
     * 今日负面总数
     * @param topics
     * @param events
     * @return
     */
    Integer getTodayNegativeCount(List<PublicOpinionTopic> topics, List<PublicOpinionEvents> events);

    /**
     * 今日舆情总数
     * @param topics
     * @param events
     * @return
     */
    Integer getTodayPublicOpinionCount(List<PublicOpinionTopic> topics, List<PublicOpinionEvents> events);

    /**
     * 近七日舆情总数
     * @param topics
     * @param events
     * @return
     */
    Integer getPastSevenDaysPublicOpinionCount(List<PublicOpinionTopic> topics, List<PublicOpinionEvents> events);

    /**
     * 近7日负面信息
     * @param topics
     * @param events
     * @return
     */
    List<NameListValue> negativeInformationHeatMap(List<PublicOpinionTopic> topics, List<PublicOpinionEvents> events);

    /**
     * 获取正负面信息趋势图
     * @param topics
     * @param events
     * @return
     */
    List<NameListValue> getSentimentByPublishTimeByTenantCode(List<PublicOpinionTopic> topics, List<PublicOpinionEvents> events);

    /**
     * 舆情数量按省分组
     * @param topics
     * @param events
     * @return
     */
    List<NameValue> getPublicOpinionCountGroupByProvinceOfTenantCode(List<PublicOpinionTopic> topics, List<PublicOpinionEvents> events);

    List<NameValue> getHotWords(List<PublicOpinionTopic> topics, List<PublicOpinionEvents> events);

    List<NameValue> getMediaActivity(List<PublicOpinionTopic> topics, List<PublicOpinionEvents> events);

    List<NameValue> getOpinionLeaders(List<PublicOpinionTopic> topics, List<PublicOpinionEvents> events);

    /**
     * 获取当前企业内的负面信息
     * @return
     */
    List<PoPublicOpinion> getNegativeListOfTenantCode(List<PublicOpinionTopic> topics, List<PublicOpinionEvents> events, int count);

    /**
     * 获取当前企业内的热门信息
     */
    List<PoPublicOpinion> getHotListOfTenantCode(List<PublicOpinionTopic> topics, List<PublicOpinionEvents> events, int count);
}
